//
//  SelectNewsView.swift
//  KaMengApplication
//
//  Created by DUONIU_MAC on 2018/10/10.
//  Copyright © 2018年 DUONIU_MAC. All rights reserved.
//

import UIKit

class SelectNewsView: UIView {
    
    fileprivate let titleLabel = UILabel()
    let selectBtn = UIButton()
    
    var title : String! {
        didSet{
            titleLabel.text = title
        }
    }
    
    var text : String! {
        didSet{
            selectBtn.setTitle(text, for: .normal)
        }
    }

    init() {
        super.init(frame: .zero)
        
        self.backgroundColor = UIColor.white
        
        titleLabel.font = UIFont.systemFont(ofSize: RATIO(maxNum: 16))
        self.addSubview(titleLabel)
        
        selectBtn.titleLabel?.font = UIFont.systemFont(ofSize: RATIO(maxNum: 16))
        selectBtn.setTitleColor(UIColor.black, for: .normal)
        self.addSubview(selectBtn)
        
        titleLabel.snp.makeConstraints { (make) in
            make.left.equalToSuperview().offset(RATIO(maxNum: 10))
            make.centerY.equalToSuperview()
            make.width.greaterThanOrEqualTo(10)
            make.height.greaterThanOrEqualTo(10)
        }
        
        selectBtn.snp.makeConstraints { (make) in
            make.right.equalToSuperview().offset(RATIO(maxNum: -10))
            make.centerY.equalToSuperview()
            make.width.greaterThanOrEqualTo(10)
            make.height.greaterThanOrEqualTo(10)
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
}
